﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace B.S.Traceability.Infrastructure.Migrations
{
    public partial class 溯源 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "SU_BreedInfo",
                columns: table => new
                {
                    BreedId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ProductionCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    BreedType = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    BreedSource = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    BreedDay = table.Column<int>(type: "int", nullable: false),
                    BreedName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    BreedBrand = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    EndTime = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SU_BreedInfo", x => x.BreedId);
                });

            migrationBuilder.CreateTable(
                name: "SU_EnterInfo",
                columns: table => new
                {
                    EnterId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ProductionCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    FarmAddr = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    PersonName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    EnterNum = table.Column<int>(type: "int", nullable: false),
                    Qualifications = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    EnterName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreateEnterTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    EnterAddress = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    EnterRemark = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    EnterPhones = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SU_EnterInfo", x => x.EnterId);
                });

            migrationBuilder.CreateTable(
                name: "SU_GoodName",
                columns: table => new
                {
                    GoodNameId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    GoodName = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SU_GoodName", x => x.GoodNameId);
                });

            migrationBuilder.CreateTable(
                name: "SU_GoodsInfo",
                columns: table => new
                {
                    GoodsId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    GoodNameId = table.Column<int>(type: "int", nullable: false),
                    ProductionCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    SellByDay = table.Column<int>(type: "int", nullable: false),
                    ProductionEnt = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    GoodsPhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    UpdateName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SU_GoodsInfo", x => x.GoodsId);
                });

            migrationBuilder.CreateTable(
                name: "SU_Health",
                columns: table => new
                {
                    HealthId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ProductionCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    BreedDay = table.Column<int>(type: "int", nullable: false),
                    HealthType = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    HealthMethod = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SU_Health", x => x.HealthId);
                });

            migrationBuilder.CreateTable(
                name: "SU_PhoneInfo",
                columns: table => new
                {
                    PhoneId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ProductionCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    PhoneType = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    PhoneUrl = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SU_PhoneInfo", x => x.PhoneId);
                });

            migrationBuilder.CreateTable(
                name: "SU_SlaughterInfo",
                columns: table => new
                {
                    SlaughterId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ProductionCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    AveKg = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    FromTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    SlaughterTime = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SU_SlaughterInfo", x => x.SlaughterId);
                });

            migrationBuilder.CreateTable(
                name: "SU_Supplier",
                columns: table => new
                {
                    SupId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ProductionCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    SupType = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    SupCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    SupPhone = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SU_Supplier", x => x.SupId);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "SU_BreedInfo");

            migrationBuilder.DropTable(
                name: "SU_EnterInfo");

            migrationBuilder.DropTable(
                name: "SU_GoodName");

            migrationBuilder.DropTable(
                name: "SU_GoodsInfo");

            migrationBuilder.DropTable(
                name: "SU_Health");

            migrationBuilder.DropTable(
                name: "SU_PhoneInfo");

            migrationBuilder.DropTable(
                name: "SU_SlaughterInfo");

            migrationBuilder.DropTable(
                name: "SU_Supplier");
        }
    }
}
